<?php

namespace com\wxPay;

use think\Exception;

/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/11/10
 * Time: 13:33
 */
class DownloadBill_pub extends Wxpay_client_pub
{
    public function __construct()
    {
        $this->url = 'https://api.mch.weixin.qq.com/pay/downloadbill';
    }

    public function createXml()
    {
        try {
            if (!isset($this->parameters['bill_date'])) {
                throw new Exception("对账单接口中，缺少必填参数bill_date！" . "<br>");
            }
            $this->values['appid'] = WxPayConf_pub::APPID;
            $this->values['mch_id'] = WxPayConf_pub::MCHID;
            $this->values['nonce_str'] = $this->createNoncestr();
            $this->values['sign'] = $this->makeSign();
            return $this->arrayToXml($this->values);
        } catch (Exception $exception) {

            exit($exception->getMessage());
        }
    }
//    public function getResult()
//    {
//        $this->postXml();
//        $this->result = $this->xmlToArray($this->response);
//        return $this->result;
//    }
}